<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
function viewApi(name) {
	var iframe = document.getElementById("iframe");
	var url = "<%=request.getAttribute("contextPath")%>/views";

    if (name == "description")
        url += "/description.jsp";
    else if (name == "login")
		url += "/api/login/login.jsp";
	else if (name == "logout")
		url += "/api/login/logout.jsp";
	else if (name == "registUser")
		url += "/api/user/registUser.jsp";
	else if (name == "duplCheck")
		url += "/api/user/duplCheck.jsp";
    else if (name == "mainInfo")
        url += "/api/mainInfo/mainInfo.jsp"
	
	iframe.src = url;
}
</script>
<body>
	<table border="1" align="center">
		<tr>
			<td rowspan="2" valign="top">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr><td align="center">목차</td></tr>
                    <tr><td><a href="javascript:viewApi('description');">개요</a></td></tr>
					<tr><td><a href="javascript:viewApi('login');">로그인</a></td></tr>
					<tr><td><a href="javascript:viewApi('logout');">로그아웃</a></td></tr>
					<tr><td><a href="javascript:viewApi('registUser');">회원가입</a></td></tr>
					<tr><td><a href="javascript:viewApi('duplCheck');">아이디 중복체크</a></td></tr>
                    <tr><td><a href="javascript:viewApi('mainInfo');">메인 정보</a></td></tr>
				</table>
			</td>
			<td>
				<table border="0" cellspacing="0" cellpadding="2">
					<tr>
						<td align="right">Client Info</td>
						<td><input type="text" id="clientInfo" style="width:400px" value="<%=request.getAttribute("clientInfo")%>" /></td>
					</tr>
					<tr style="display:none;">
						<td align="right">Context Path</td>
						<td><input type="text" id="contextPath" style="width:400px" value="<%=request.getAttribute("contextPath")%>" /></td>
					</tr>
					<tr>
						<td align="right">Token</td>
						<td><input type="text" id="token" style="width:400px;" /></td>
					</tr>
				</table>
			</td>			
		</tr>
		
		<tr>
			<td><iframe id="iframe" width="100%" height="600px" /></td>
		</tr>
	</table>
</body>
</html>